package physics.MovementControl;

import physics.GameObject;

import common.Math3D;
import common.Point3D;


public class MissileMovementController extends AbstractMovementController {
	

	public MissileMovementController(GameObject object) {
		super(object);
		hasMomentum = false;
		movementFriction = 0.05;
		movementLimit = 0.5;
		rotationLimit = 0.01;
		rotationFriction = 0.05;
	}	

	@Override
	protected void doMoveMomentum() {
		
		super.doMoveMomentum();
		
	}

	@Override
	protected void doRotationMomentum() {
		super.doRotationMomentum();
	}

	@Override
	
	protected void updateMomentum() {
			super.updateMomentum();
	}

	@Override
	protected void limitMovement() {
		double veticalstr = Math3D.getDotProduct(object.getUp(),
				movementMomentum);
		movementMomentum.sub(Math3D.scalePoint(object.getUp(), veticalstr));
		super.limitMovement();
		movementMomentum.add(Math3D.scalePoint(object.getUp(), veticalstr));

	}
	
	
	@Override
	public boolean inTheAir(){
		return (object.getPlanet().surfaceDistance(object) - 0.001 > 0.001);
	}

	
	
	
}
